for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
// Exception.js
"use strict";
// :: DEPENDENCIES
// load native dependencies
const path = require("path");
// load local dependencies
const Throwable = require(path.join(__dirname, "Throwable.js"));
// :: BASIC SETUP
/**
* The class <tt>Exception</tt> and its subclasses are a form of <tt>Throwable</tt> that indicates conditions that a
* reasonable application might want to catch.
* @param {String} name - The name of the <tt>Exception</tt>.
* @param {String} message - The message describing the <tt>Exception</tt>.
* @param {Number} code - The unique code that identifies the cause of the <tt>Exception</tt>.
* @augments Throwable
* @constructor
* @see https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html
*/
const Exception = function (name, message, code) {
Throwable.call(this, name, message, code);
};
// :: INHERITANCE
// set the prototype chain parent to the Throwable 'class'
Exception.prototype = Object.create(Throwable.prototype);
// set the prototype chain constructor
Exception.prototype.constructor = Exception;
// :: PROTOTYPE
* The name used to identify an <tt>Exception</tt>.
* @type {String}
* @default
Exception.prototype.name = "Exception";
// :: EXPORT
// export the Exception 'class'
module.exports = Exception;